<extend name="Base:common" />
<block name="static">
<link rel="stylesheet" href="__CSS__/cartpaylist.css" />
</block>
<block name="body">
		<!----加载商品楼层start-->
		<div class="wst-container">
			 <div>
                <div id="succeed">
                    <div class="success2">
                        <div class="wst-cart-left-blank"></div>
                        <div class="wst-cart-step">
                            <img src="__IMG__/step1.png" /><br />
                            <span class="wst-cart-step1">1.我的购物车</span>
                            <span class="wst-cart-step2">2.填写核对订单信息</span>
                            <span class="wst-cart-step3">3.成功提交订单</span>
                        </div>
                        <div class="wst-clear"></div>
                    </div>
                </div>
            </div>

            <div class="wst-cart-container">
                <div class="wst-cart-title">
               		我的购物车
                </div>
                <div id="showwarnmsg">
                	抱歉，您购物车中的部分商品缺货，或库存不足，请删除被标记的商品或修改购买数量再进行结算。
                </div>
                <div class="wst-cartlist-box">
                    <div class="wst-cartlist-head">
                        <div class="wst-head-title1">
		                	<input type="checkbox" id="chk_all"/>&nbsp;全选
						</div>
                        <div class="wst-head-title2">商品</div> 
                        <div class="wst-head-title3">店铺名称</div>                      
                        <div class="wst-head-title4">商品单价</div>
                        <div class="wst-head-title5">库存状态</div>
                        <div class="wst-head-title6">数量</div>
                        <div class="wst-head-title7">总价</div>
                        <div class="wst-head-title8">操作</div>
                        <div class="wst-clear"></div>
                    </div><br/>
                <div id="wst_cartlist_pbox">
                <empty name="cartInfo['cartgoods']">
                <div style="text-align:center;font-size:20px;line-height:80px;">
               	您的购物车空空如也，赶快开始购物吧！
                </div>
                <br/>
                </empty>
                <volist name="cartInfo['cartgoods']" id="shopgoods">
                <div id="wst_cart_shop_{$key}" data="{$key}">
                <div>
                	<div class="wst-head-check">
                		<input type="checkbox" id="chk_shop_{$key}" value="{$key}" name="chk_shop"/>
                	</div>
             		<div class="wst-cart-dp-pb1">
                 		<span class="wst-cart-shop-span"><span id="sp_{$shopgoods['shopgoods'][0]['shopId']}">{$shopgoods["shopgoods"][0]["shopName"]}</span></span>&nbsp;&nbsp;&nbsp;&nbsp;
             			<if condition="$shopgoods['shopgoods'][0]['qqNo'] neq ''">
							<a href="tencent://message/?uin={$shopgoods['shopgoods'][0]['qqNo']}&Site=QQ交谈&Menu=yes">
								<img border="0" src="http://wpa.qq.com/pa?p=1:{$shopgoods['shopgoods'][0]['qqNo']}:7" alt="QQ交谈" width="71" height="24" />
							</a>
						</if>
             		</div>
             		<div class="wst-goods-tips">
                 		 包邮起步价：¥{$shopgoods["shopgoods"][0]["deliveryFreeMoney"]}元
                	</div>
            		<div style="clear: both;"></div>
          		</div>
                <div class="wst-cartlist-box">
                    
                    <div id="catgoodsList">
                        <volist name="shopgoods['shopgoods']" key="key2" id="goods">
                        <input type="hidden" value="<if condition="$goods['goodsStock'] lt $goods['cnt']">-1</if>" class="goodsStockFlag"/>
							<div class="wst-cartlist-item" id="selgoods_{$goods['goodsId']}_{$goods['goodsAttrId']}_{$goods['isSeckill']}_{$goods['isGroup']}" class="selgoods" <if condition="$goods['goodsStock'] lt $goods['cnt']">style="border:2px solid red;"</if>>
		                        <div class="wst-cartlist-vb">
		                            <input type="checkbox" id="chk_goods_{$goods['goodsId']}_{$goods['goodsAttrId']}_{$goods['isSeckill']}_{$goods['isGroup']}" name="chk_goods_{$goods['shopId']}" value="{$goods['goodsId']}_{$goods['goodsAttrId']}_{$goods['isSeckill']}_{$goods['isGroup']}" parent="{$goods['shopId']}" isBook="{$goods['isBook']}" <if condition="$goods['ischk'] eq 1">checked</if>/>
									<input type="hidden" class="cgoodsId" value="{$goods['goodsId']}_{$goods['goodsAttrId']}_{$goods['isSeckill']}_{$goods['isGroup']}" />

		                        </div>
		                        <div class="wst-cartlist-item-col1">
		                            <div>
		                                <div class="wst-cartlist-bximg">
		                                 	<a target="_blank" href="{:U('Home/Goods/getGoodsDetails/',array('goodsId'=>$goods['goodsId']))}" target="_blank">
		                                        <img src="__ROOT__/{$goods['goodsThums']}" width="60" height="60" />
		                                    </a>
		                                </div>
		                                <div class="wst-cartlist-gsname">
		                                    <a target="_blank" href="{:U('Home/Goods/getGoodsDetails/',array('goodsId'=>$goods['goodsId']))}" target="_blank">
		                                    {$goods["goodsName"]}</a>
											<if condition="$goods['isGroup'] eq 1"><span style='color:#e6126a'>【团购】</span></if>
											<if condition="$goods['isSeckill'] eq 1"><span style='color:#e6126a'>【秒杀】</span></if>
                                            <volist name="goods" id="attrs">
                                                  <?php if(is_numeric($key)){ ?>
                                                        【{$attrs['attrName']}:{$attrs['attrVal']}】
                                                        <?php $shopsPrice+=$attrs['shopPrice']?>  
                                                    <?php }?>
													
                                            </volist>
		                                    <input type="hidden" id="price_{$goods['goodsId']}_{$goods['goodsAttrId']}_{$goods['isSeckill']}_{$goods['isGroup']}" value="<?php if($goods['isGroup']==0  and $goods['isSeckill']==0){ ?>
                                                <?php if($shopsPrice==0){ ?>
                                                    {$goods['shopPrice']}
                                                <?php }else{ echo $shopsPrice+$goods['shopPrice'];} ?>
                                            <?php }else{ ?>
                                                {$goods['shopPrice']}
                                            <?php }?>" />
		                                </div>
		                            </div>
		                        </div>
		                        <div class="wst-cartlist-item-col2">
		                        	<a target="_blank" href="{:U('Home/Shops/toShopHome/',array('shopId'=>$goods['shopId']))}" title="{$goods['shopName']}">{$goods['shopName']}</a>
		                        </div>
		                        <div class="wst-cartlist-item-col3">¥ 
									<?php if($goods['isGroup']==0  and $goods['isSeckill']==0){ ?>
                                        <!--正常商品价格-->
										<?php if($shopsPrice==0){ ?>
											{$goods['shopPrice']}
										<?php }else{ echo $shopsPrice+$goods['shopPrice'];} ?>
									<?php }else{ ?>
                                        <!--团购或秒杀价格-->
										{$goods['shopPrice']}
									<?php }?>
                                 元</div>

		                        <div class="wst-cartlist-item-col4" id="stock_{$goods['goodsId']}_{$goods['goodsAttrId']}_{$goods['isSeckill']}_{$goods['isGroup']}">
			                		<if condition="$goods['goodsStock'] egt $goods['cnt']">
	                                                                                                有货
	                        		<elseif condition="$goods['goodsStock'] eq 0"/>
	                                   	<span style="color:red;">无货</span>
	                           		<else/>
	                                    <span style="color:red;">库存不足,仅剩{$goods["goodsStock"]}份</span>
	                         		</if>
		                        </div>
		                        <div class="wst-cartlist-item-col5">
		                            <div class="wrap-input" style="">
		                                <button id="numl_{$goods['goodsId']}_{$goods['goodsAttrId']}" class="wst-cartlist-plus" onclick="changeCatGoodsnum(1,{$goods['shopId']},{$goods['goodsId']},'{$goods['goodsAttrId']}',{$goods['isBook']},{$goods['isGroup']},{$goods['isSeckill']})">-</button>
                                        <input id="buy-num_{$goods['goodsId']}_{$goods['goodsAttrId']}_{$goods['isSeckill']}_{$goods['isGroup']}" dataId="{$goods['goodsAttrId']}" class="text" style="width: 30px; text-align: center;" maxlength="3" value="{$goods['cnt']}" onkeypress="return WST.isNumberKey(event);" onkeyup="changeCatGoodsnum(0,{$goods['shopId']},{$goods['goodsId']},'{$goods['goodsAttrId']}',{$goods['isBook']},{$goods['isGroup']},{$goods['isSeckill']});" />
                                        <button id="numr_{$goods['goodsId']}_{$goods['goodsAttrId']}" class="wst-cartlist-add" onclick="changeCatGoodsnum(2,{$goods['shopId']},{$goods['goodsId']},'{$goods['goodsAttrId']}',{$goods['isBook']},{$goods['isGroup']},{$goods['isSeckill']})">+</button>
		                            </div>
		                        </div>
		                        <div class="wst-cartlist-item-col7">¥<span id="prc_{$goods['goodsId']}_{$goods['goodsAttrId']}_{$goods['isSeckill']}_{$goods['isGroup']}">
                               <if condition="($goods['isGroup'] eq 0) AND ($goods['isSeckill'] eq 0)">
                                    <?php if($shopsPrice* $goods["cnt"]==0){ ?>
                                        {$goods["shopPrice"] * $goods["cnt"]}
                                    <?php }else{ ?><?php echo ($shopsPrice+$goods["shopPrice"])* $goods["cnt"];?><?php $shopsPrice=0;?><?php }?>
                                <else />
                                    {$goods["shopPrice"] * $goods["cnt"]}
									<?php $shopsPrice=0;?>
                                </if>
                                </span>元</div>
		                        <div class="wst-cartlist-item-col8"><a href="javascript:delCatGoods({$goods['shopId']},{$goods['goodsId']},'{$goods['goodsAttrId']}',{$goods['isGroup']},{$goods['isSeckill']});">删除</a></div>
		                        <div class="wst-clear"></div>
		                    </div>
                        </volist>
                        
						<if condition="count($cartInfo['cartgoods']) lt 1">
						<div class='wst-cart-empty'>购物车中没有商品</div>
                        </if>
                    </div>
                    <div class="wst-cart-total-money">
                       	 总计（不含运费）:<span class="wst-cart-unin">¥<span id="shop_totalMoney_{$goods['shopId']}">{$shopgoods["totalMoney"]}</span>元&nbsp;&nbsp;</span>
                    </div>
                </div>
                <br/>
                </div>
                </volist>
                </div>
                <div class="checkout-buttons group" id="checkout-floatbar">
                        <div class="wst-chkod-yf1">
                        	<span class="total">应付总额(不含运费)：<span style="color: red;">
	                                <strong id="payPriceId">￥
		                                <span id="wst_cart_totalmoney" class="wst-cart-totalmoney">{$cartInfo['totalMoney']}</span>
	                                </strong>元</span>
                                </span>
                        </div>
                        
                    </div>
                <div>&nbsp;</div>
                <div class="cart-button clearfix">

                    <li class="wst-btn-continue" onclick="javascript:toContinue();"></li>
                    <li class="wst-btn-checkout" onclick="javascript:goToPay();" style="<if condition="count($cartInfo['cartgoods']) lt 1">display: none;</if>"></li>
                   	<div class="wst-clear"></div>
                </div>
            </div>
        
			<div class="wst-clear"></div>
		</div>

   	</block>
<block name="footer_static">
	<script src="__PUBLIC__/plugins/layer/layer.min.js"></script>
	<script src="__JS__/cartpaylist.js"></script>   	
</block> 




